#ifndef REPLACERULESMODEL_H
#define REPLACERULESMODEL_H

#include <QAbstractTableModel>
#include <QRegExp>
#include <QPair>
class ReplaceRulesModel : public QAbstractTableModel
{
Q_OBJECT
public:
    explicit ReplaceRulesModel(QObject *parent = 0);
    void setList(QList< QPair<QRegExp, QString> > *replaceRulesList);
    int rowCount(const QModelIndex &parent) const;
    int columnCount(const QModelIndex &parent) const;
    QVariant data(const QModelIndex &index, int role) const;
    bool setData(const QModelIndex &index, const QVariant &value, int role);
    QVariant headerData(int section,Qt::Orientation orientation, int role) const;
    Qt::ItemFlags flags(const QModelIndex &index) const;
    void update();
    bool insertRows(int row, int count, const QModelIndex& parent);
    bool removeRows(int row, int count, const QModelIndex& parent);
    bool moveUp(int row, const QModelIndex& parent = QModelIndex());
    bool moveDown(int row, const QModelIndex& parent = QModelIndex());
private:
    QList< QPair<QRegExp, QString> > *m_replaceRulesList;
};

#endif // REPLACERULESMODEL_H
